<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>旅行 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="webmall Team" />
<meta name="Copyright" content="webmall" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "/WEB-INF/template/common/include.ftl">
<link href="${base}/template/shop/css/login.css" rel="stylesheet" type="text/css" />
<link href="${base}/template/shop/css/register.css" rel="stylesheet" type="text/css" />
<link href="${base}/template/webmall/css/trip.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/template/shop/js/login.js"></script>
<script type="text/javascript" src="${base}/template/shop/js/register.js"></script>
<script type="text/javascript" src="${base}/template/shop/js/product.js"></script>

<script type="text/javascript">
$().ready( function() {
	$("#airticketForm").validate();
	$('span[name="personIndex"]').each(function(i){				
		$(this).html(i);
		$(this).parents('.copyTable').find(".objName").each(function(j){
			var newName = $(this).attr("objName").replace("[:name]","["+(i-1)+"]");
			$(this).attr("name",newName);
		});
	 });
		
	$('div.cycle_parent div.cycle').each(function(i){
		$('#'+this.id).cycle({ 
				fx:'scrollLeft',
				pager:'#'+this.id+'_btn'
		});
	 });
	 
	$(".trip .option .tripTypeClass input[type='radio']").click( function() {
			if(this.value=='s')
			{
				$("#endDataParent").hide();
				$("input[name='toFlight.departureDate']").attr("disabled",true);
			}
			else
			{
				$("input[name='toFlight.departureDate']").removeAttr("disabled");
				$("#endDataParent").show();
			}
	});
	$('#addPerson').click(function()
		{
			try
			{
				$('.hide .commonTable').clone(true).appendTo("#persons");
				
				$('span[name="personIndex"]').each(function(i){				
					$(this).html(i);
					$(this).parents('.copyTable').find(".objName").each(function(j){
						var newName = $(this).attr("objName").replace("[:name]","["+(i-1)+"]");
						$(this).attr("name",newName);
					});
				 });
			}
			catch(e)
			{
				alert(e);
			}
		}
	);
	
	$('.removeBtn').click(function()
		{
			try
			{
				$(this).parents('.commonTable').remove();
				$('span[name="personIndex"]').each(function(i){
					$(this).html(i);
				 });
			}
			catch(e)
			{
			}
		}
	);
	
	
	//$('#persons').clone().appendTo('#persons');
	
})

function switchID(event){
	var $this = $(this);
	switch($this.value)
	{
		case 'NI':
		$this.attr('class',$(this).metadata().NI);
			break;
		case 'FOID':
		$this.attr('class',$(this).metadata().FOID);
			break;
		case 'ID':
		$this.attr('class',$(this).metadata().ID);
			break;
	}
}



</script>
</head>

<body class="trip">
<#assign checkedMenuId='402881882ba98cce012ba9d5cd0f0019'/>
	<#include "/WEB-INF/template/shop/tripheader.ftl">
	<div class="body">
	<div class="hide">
		<table class="commonTable copyTable">
			<tr>
				<th colspan="2" style="text-align:left;">乘机人<span name="personIndex"></span>&nbsp;<button class="removeBtn"></button></th>
				<input name="passenger.psgID" objName="passenger[:name].psgID" type="hidden" class="objName formText" />
			</tr>
			<tr>
				<td class="element"><span class="lbl_require">*</span>购票类型:
					<select name="passenger.psgType" objName="passenger[:name].psgType" class="objName formText required" >
						<option value="ADT">-成人-</option>
						<option value="CHD">-儿童-</option>
						<option value="INF">-婴儿-</option>
						<option value="UM">-无陪伴儿童-</option>
					</select>
				</td>
				<td class="element"><span class="lbl_require">*</span>乘客姓名:
					<input type="text" name="passenger.name" objName="passenger[:name].name" class="objName formText required" />
				</td>
			</tr>
			<tr>
				<td class="element"><span class="lbl_require">*</span>证件类型:
					<select name="passenger.cardType" objName="passenger[:name].cardType" class="objName formText required">
						<option value="NI">-身份证-</option>
						<option value="FOID">-驾驶证-</option>
						<option value="ID">-其他类型-</option>
					</select>
				</td>
				<td class="element"><span class="lbl_require">*</span>证件号码:
					<input name="passenger.cardNo" objName="passenger[:name].cardNo" class="objName formText required" />
				</td>
			</tr>
			<tr>
				<td class="element"><span class="lbl_require">*</span>出生日期:
					<input name="passenger.birthDay" objName="passenger[:name].birthDay" class="objName formText required"  onFocus="WdatePicker()" />
				</td>
				<td class="element">
				<div class="inpputGJ hide">
					<span class="lbl_require">*</span>国家:
					<input name="passenger.country" objName="passenger[:name].country" class="objName formText required" />
				
				</div>
				</td>
			</tr>
			<tr>
				<td class="element"><span class="lbl_require">*</span>手机号码:
					<input name="passenger.mobilePhone" objName="passenger[:name].mobilePhone" class="objName formText required" />
				</td>
				<td class="element"><span class="lbl_require">&nbsp;</span>电子邮箱:
				<input name="passenger.email" objName="passenger[:name].email" class="objName formText" />
				</td>
			</tr>
			
			<tr>
				<td class="element" colspan="2"><span class="lbl_require">&nbsp;</span>保      险:
					<input type="hidden" name="passenger.insueFee" objName="passenger[:name].insueFee" class="objName formText" />
					<select name="passenger.insueSum" objName="passenger[:name].insueSum" class="objName formText">
						<option value="0">0</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
					</select>
				</td>
			</tr>
		</table>
	</div>
	<form id="airticketForm" action="${base}/shop/trip!pays.action" method="post">
		<div class="blank"></div>
		<div class="nav">
			<div class="flight">
				填写订单信息
			</div>
			<div class="flow">
				<#if (tickeType=='s')>
					<div class="trip_nav_first_three">去程</div>
				<#else>
					<div class="trip_nav_first_one">去程</div>
					<div class="trip_nav_middle_three">回程</div>
				</#if>
				<div class="trip_nav_middle_two">填写</div>
				<div class="trip_nav_middle_one">支付</div>
				<div class="trip_nav_last_one">完成</div>
			</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="title">所选航班
				 &nbsp;&nbsp;${fromCityName}-${toCityName}
				<#if (tickeType=='s')>
						（单程）
					<#else>
						（往返）
					</#if>
				</div>
			<div class="content" >
				<table class="commonTable">
					<tr>
						<th>航程 </th>
						<th> 航班信息 </th>
						<th>
							起飞时间/起飞机场
						</th>
						<th>
							抵达时间/抵达机场
						</th>	
						<th>
							机建/燃油费
						</th>
						<th>
							单价
						</th>
						<th>
							备注
						</th>
					</tr>
					<#if (Session["fromFlight"] != null)>
					<tr>
						<td>
							（去程）
						</td>
						<td>
						
							${Session["fromFlight"].companyName} 
							<br/>
							${Session["fromFlight"].flightNo} 
						</td>
						<td>
							 ${Session["fromFlight"].getDepartureTime()} 
							 <br/>
							${Session["fromFlight"].fromAirPortName} 
						</td>
						<td>
							 ${Session["fromFlight"].getArrivalTime()} 
							 <br/>
							${Session["fromFlight"].arrivalAirPortName} 
						</td>	
						<td>
							<span>
								 ${Session["fromFlight"].getAirportTax()} 
								/
								 ${Session["fromFlight"].getFuelSurTax()} 
							</span>
						</td>
						<td>
							 ${Session["fromFlight"].getClassPrice()} 
						</td>
						<td>
							
						</td>
					</tr>
					</#if>
					
					<#if (Session["toFlight"] != null)>
					<tr>
						<td>（返程）</td>
						<td>
						
							${Session["toFlight"].companyName} 
							<br/>
							${Session["toFlight"].flightNo} 
						</td>
						<td>
							 ${Session["toFlight"].getDepartureTime()} 
							 <br/>
							${Session["toFlight"].fromAirPortName} 
						</td>
						<td>
							 ${Session["toFlight"].getArrivalTime()} 
							 <br/>
							${Session["toFlight"].arrivalAirPortName} 
						</td>	
						<td>
							<span>
								 ${Session["toFlight"].getAirportTax()} 
								/
								 ${Session["toFlight"].getFuelSurTax()} 
							</span>
						</td>
						<td>
							 ${Session["toFlight"].getClassPrice()} 
						</td>
						<td>
							
						</td>
					</tr>
					</#if>
				</table>
			</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="title">乘机人信息</div>
			<div class="content" style="display:block;">
				<div id="persons">	
				<table class="commonTable copyTable">
				<tr>
					<th colspan="2" style="text-align:left;">乘机人<span name="personIndex"></span>&nbsp;</th>
					<input name="passenger.psgID" objName="passenger[:name].psgID" type="hidden" class="objName formText" />
				</tr>
				<tr>
					<td class="element"><span class="lbl_require">*</span>购票类型:
						<select name="passenger.psgType" objName="passenger[:name].psgType" class="common_select objName formText required" >
							<option value="ADT">-成人-</option>
							<option value="CHD">-儿童-</option>
							<option value="INF">-婴儿-</option>
							<option value="UM">-无陪伴儿童-</option>
						</select>
					</td>
					<td class="element"><span class="lbl_require">*</span>乘客姓名:
						<input type="text" name="passenger.name" objName="passenger[:name].name" class="objName formText required" />
					</td>
				</tr>
				<tr>
					<td class="element"><span class="lbl_require">*</span>证件类型:
						<select name="passenger.cardType" objName="passenger[:name].cardType" class="common_select objName formText required">
							<option value="NI">-身份证-</option>
							<option value="FOID">-驾驶证-</option>
							<option value="ID">-其他类型-</option>
						</select>
					</td>
					<td class="element"><span class="lbl_require">*</span>证件号码:
						<input name="passenger.cardNo" objName="passenger[:name].cardNo" class="objName formText required" />
					</td>
				</tr>
				<tr>
					<td class="element"><span class="lbl_require">*</span>出生日期:
						<input name="passenger.birthDay" objName="passenger[:name].birthDay" class="objName formText required"  onFocus="WdatePicker()" />
					</td>
					<td class="element">
						<div class="inputGJ hide">
							<span class="lbl_require">*</span>国家:
							<input name="passenger.country" objName="passenger[:name].country" class="objName formText" />
						</div>
					</td>
				</tr>
				<tr>
					<td class="element"><span class="lbl_require">*</span>手机号码:
						<input name="passenger.mobilePhone" objName="passenger[:name].mobilePhone" class="objName formText required phone" />
					</td>
					<td class="element"><span class="lbl_require">&nbsp;</span>电子邮箱:
						<input name="passenger.email" objName="passenger[:name].email" class="objName formText email" />
					</td>
				</tr>
				
				<tr>
				<td class="element" colspan="2"><span class="lbl_require">&nbsp;</span>保      险:
					<input type="hidden" name="passenger.insueFee" objName="passenger[:name].insueFee" class="objName formText" />
					<select name="passenger.insueSum" objName="passenger[:name].insueSum" class="common_select objName formText">
						<option value="0">0</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
					</select>
				</td>
			</tr>
		</table>
				</div>
				<button id="addPerson" class="btn_blue font_white" style="border:none;margin-left:18px;margin-top:10px;" onclick="return false;">+新增乘机人</button>
			</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="title">联系人信息</div>
			<div class="content">
				<table class="commonTable">
					<tr>
						<td class="element" ><span class="lbl_require">*</span>收货人姓名:
							<input name="linkerInfo.linkerName" class="objName formText required"  />
						</td>
						<td class="element"><span class="lbl_require">*</span>手机号码:
							<input name="linkerInfo.mobilePhone" class="objName formText required phone" />
						</td>
					</tr>
					<tr>
						<td class="element"><span class="lbl_require">*</span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:
							<input name="linkerInfo.address" class="objName formText required range[5,500]" />
						</td>
						<td class="element"><span class="lbl_require">*</span>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编:
							<input name="linkerInfo.zip" class="objName formText required zipCode" />
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="title">配送方式&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="sendType" value="0" />无需配送<input type="radio" name="sendType" value="0" />机场自取<input type="radio"  name="sendType" value="0" />邮寄行程单</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="title">付款确认</div>
			<div class="content">
				支付类型：
						<select name="linkerInfo.payType" class="common_select objName formText required" >
							<option value="WZ">-网络支付-</option>
							<option value="ZH">-账户-</option>
						</select>
			</div>
		</div>
		<div class="blank"></div>
		<div class="blockDiv">
			<div class="content" style="height:60px;line-height:60px;text-align:center;">
				<input class="btn_blue" type="button" style="border:none;margin:auto;" onclick="history.back(-1);" value="上一步" />
				<input class="btn_blue" type="submit" style="border:none;margin:auto;" value="提交订单" onclick="$('#airticketForm').submit();" />
			</div>
		</div>
		</form>
	</div>
		
	<div class="blank"></div>
	<#include "/WEB-INF/template/shop/footer.ftl">
</body>
</html>
